<?php
namespace app\spadmin\controller\device;
use app\common\controller\Backend;
use think\Db;
class Place extends Backend{

    public function _initialize()
    {
        parent::_initialize();
        $this->model = model('DeviceEngine');
        

    }

    public function index(){
        $this->request->filter(['strip_tags', 'trim']);
        if($this->request->isAjax()){
            $data = $this->request->param();
            if (isset($data['keywords']) && $data['keywords']) {
                $map['engine_name'] = ['like', '%' . $data['keywords'] . '%'];
            }           
            
            $map['status'] = 1;         
            $list =   $this->model->where($map)->order('id desc')->paginate($data['limit'])->toArray();
            
            return $this->result($list);
        }
        return $this->view->fetch();
    }
    
}